﻿
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no,email=no,address=no" />
    <title>登录</title>
    <link href="css/common.css" rel="stylesheet" />
    <link href="css/user.css" rel="stylesheet" />
    
</head>

<body class="upage">
    <div class="uico"><img src="/zhekou/dl/img/default_1.png"></div>
    <div class="pageSignUp" ng-controller="loginCtrl">
        <form action="#" method="post" id="loginForm">
            <ul>
                <li>
                    <span>
                        <ins class="icon-user2"></ins>
                        <input type="text" id="username" name="username" class="itext" placeholder="请输入您的账号">
                    </span>
                </li>
                <li>
                    <span>
                        <ins class="icon-unlocked"></ins>
                        <input type="password" id="password" name="password" maxlength="20" class="itext" placeholder="请输入您的密码">
                    </span>
                </li>
                <li class="codeLine">
                    <i class="cdArea">
                        <b class="codeImg"><img src="http://m.xigou100.com/user/verify" style="height:40px; vertical-align:top;" /></b>
                        <a class="vcode_refresh" href="javascript:void(0)"><div class="icon_refresh"></div></a>
                    </i>
                    <span>
                        <ins class="icon-drawer2"></ins>
                        <input type="text" maxlength="4" id="verify1" name="verify1" class="itext" placeholder="输入图形验证码">
                    </span>
                </li>
               
                <li> <a id="btnLogin" class="btn blue" href="javascript:void(0)">登录</a></li>
            </ul>
           
        </form>
    </div>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="http://apps.bdimg.com/libs/layer/2.1/layer.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery.cookie/1.4.1/jquery.cookie.js"></script>
    <script>
        /****** 登录配置{ ******/
        $(document).ready(function (e) {
            $('#btnLogin').click(function ()
            {

                var username = $('#username').val();
                if (username == '') {
                    $('#username').focus();
                    layer.open({
                        content: '请输入账户',
                        style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                        time: 2,
                        shade: false
                    });
                    return false;
                }
                var password = $('#password').val();
                if (password == '') {
                    $('#password').focus();
                    layer.open({
                        content: '请输入密码',
                        style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                        time: 2,
                        shade: false
                    });
                    return false;
                }
                var data = $('#loginForm').serialize();

                $.post(
                    '/postlogin.html',
                    data,
                    function (res)
                    {
                        if (res.State == true)
                        {
                            setCookie("Authorization", res.Datas, 2 * 60 * 3600);
                            window.location.href = '/agent.html';
                        }
                        else
                        {
                            layer.open({
                                content: resp.Message,
                                style: 'background:rgba(0,0,0, .6); color:#fff; border:none;',
                                time: 2,
                                shade: false
                            });
                        }
                    },
                    'json'
                );
            });

        });
    
     

     



       

        /****** 刷新图形验证码{ ******/
        $(function () {
            $('.vcode_refresh, .codeImg').click(function () {
                var $img = $(this).parents('.cdArea').find('img');
                imgSrc = $img.prop('src');
                imgSrc = imgSrc.replace(/\?.+$/, '') + '?' + new Date().getTime();
                $img.prop('src', imgSrc);
            });
        });
        /****** 刷新图形验证码} ******/



        //function fq_alert(info) {
        //    $('#fq_alert_info').text(info);
        //    $('#fq_alert').modal();
        //}

        //$(function () {
        //    $('#submit').click(function () {
        //        var username = $.trim($('#username').val());
        //        var password = $.trim($('#password').val());
        //        if (username.length == 0) {
        //            fq_alert('请输入用户名');
        //            return;
        //        }
        //        if (password.length == 0) {
        //            fq_alert('请输入密码');
        //            return;
        //        }
        //        $.post('/postlogin.html', { "username": username, "password": password }, function (res) {
        //            if (res.State == true) {
        //                setCookie("Authorization", res.Datas, 2 * 60 * 3600);
        //                window.location.href = '/agent.html';
        //            } else {
        //                $('#fq_alert_info').text(res.Message);
        //                $('#fq_alert').modal();
        //            }
        //        });
        //    });
        //});
    </script>
    
</body>
</html>